﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using CSharp4ExpressionMetaCompiler;
using SStuff.MetaEffects.Model;

namespace Sample2_CompositeShader.Providers
{
    public class WaveProvider : ITexCoordModifierProvider
    {
        public Expression<Action<TexCoordOnlyParameters>> GetShaderExpression()
        {
            return o =>
                Block.Declare(new TexCoordOnlyParameters(), vars =>
                Block.Default
                    .Assign(vars.TexCoord, new float2(vars.TexCoord.x, 
                                                      vars.TexCoord.y + 0.05f * hlsl.sin(20.0f * vars.TexCoord.x))));
        }
    }
}
